package com.xmut.mall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xmut.mall.member.utils.PageUtils;
import com.xmut.mall.member.entity.MemberReceiveAddressEntity;
import com.xmut.mall.member.utils.RespBean;

import java.util.List;
import java.util.Map;

/**
 * 会员收货地址
 *
 * @author 1912120131suntingxing
 * @email 1192081604@qq.com
 * @date 2022-07-14 01:20:45
 */
public interface MemberReceiveAddressService extends IService<MemberReceiveAddressEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 用户添加收货地址
     * @param address
     * @return
     */
    RespBean addUserReceive(MemberReceiveAddressEntity address);

    /**
     * 根据用户id获取用户的收货地址
     * @param userId
     * @return
     */
    List<MemberReceiveAddressEntity> getUserReceiveByUserId(Long userId);

    /**
     * 根据id获取用户收货地址
     * @param id
     * @return
     */
    MemberReceiveAddressEntity getReceiveAddressById(Long id);

    /**
     * 修改用户收货地址的详细数据
     * @param address
     * @return
     */
    Boolean updateUserReceiveAddress(MemberReceiveAddressEntity address);

    /**
     * 获取用户的默认收货地址
     * @param id
     * @return
     */
    MemberReceiveAddressEntity getDefaultReceiveAddressById(Long id);

    /**
     * 删除用户的收货地址
     * @param id
     * @return
     */
    RespBean deleteUserReceiveAddress(Long id);

    /**
     * 设置默认收货地址
     * @param params
     * @return
     */
    RespBean setDefaultAddress(Map<String, Object> params);
}

